home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1998 Special / special1988a.d64 / autoboot maker (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  2KB  |  89 lines

  1. 90 print"[147]"
  2. 100 input "name of program to load";pn$
  3. 110 input "name of boot program";bn$
  4. 120 input "location to jump after load";loc$
  5. 130 if loc$="" then basic=1:goto 160
  6. 140 if left$(loc$,1)="$" then gosub 760:goto 160
  7. 150 loc=val(loc$)
  8. 160 input "kill runstop/restore (y/n)";rn$
  9. 170 rn$=left$(rn$,1)
  10. 180 if not (rn$="y" or rn$="n") then 160
  11. 190 open 15,8,15,"i"
  12. 200 open 8,8,8,"0:"+bn$+",p,w"
  13. 210 print#8,chr$(167)chr$(02);
  14. 220 print#8,chr$(len(pn$));
  15. 230 print#8,pn$;
  16. 240 if rn$="n" then 380
  17. 250 for c=1 to 17
  18. 260 read code
  19. 270 print#8,chr$(code);
  20. 280 next c
  21. 290 data 120         : rem sei
  22. 300 data 169,052     : rem lda #52
  23. 310 data 141,020,003 : rem sta $0314
  24. 320 data 169,134     : rem lda #134
  25. 330 data 141,024,003 : rem sta $0318
  26. 340 data 169,234     : rem lda #234
  27. 350 data 141,025,003 : rem sta $0319
  28. 360 data 088         : rem cli
  29. 370 goto 390
  30. 380 for c=1 to 17:read code:next c
  31. 390 for c=1 to 38
  32. 400 read code
  33. 410 print#8,chr$(code);
  34. 420 next c
  35. 430 data 169,002     :rem lda #2
  36. 440 data 162,008     :rem ldx #8
  37. 450 data 160,255     :rem ldy #255
  38. 460 data 032,186,255 :rem jsr $ffba
  39. 470 data 173,167,002 :rem lda $02a7
  40. 480 data 162,168     :rem ldx #$a8
  41. 490 data 160,002     :rem ldy #$02
  42. 500 data 032,189,255 :rem jsr $ffbd
  43. 510 data 169,000     :rem lda #$00
  44. 520 data 032,213,255 :rem jsr $ffd5
  45. 530 data 169,131     :rem lda #131
  46. 540 data 141,002,003 :rem sta $0302
  47. 550 data 169,164     :rem lda #164
  48. 560 data 141,003,003 :rem sta $0303
  49. 570 data 134,045     :rem stx $2d
  50. 580 data 132,046     :rem sty $2e
  51. 590 if basic=1 then gosub 860:goto 620
  52. 600 l1=int(loc/256):l2=loc-(l1*256)
  53. 610 print#8,chr$(76)chr$(l2)chr$(l1);
  54. 620 if rn$="y" then bu=58+len(pn$)+1
  55. 630 if rn$="n" then bu=41+len(pn$)+1
  56. 640 if basic=1 then bu=bu+11
  57. 650 bl=88-bu
  58. 660 for c=1 to bl+1:print#8,chr$(0);:next c
  59. 670 print#8,chr$(139)chr$(227);
  60. 680 b=679+len(pn$)+1
  61. 690 l1=int(b/256):l2=b-(l1*256)
  62. 700 print#8,chr$(l2)chr$(l1);
  63. 710 close8
  64. 720 get#15,a$:s=st
  65. 730 print a$;
  66. 740 if s=0 then 720
  67. 750 end
  68. 760 l=len(loc$)
  69. 770 s=l-1
  70. 780 for c=1 to l
  71. 790 i$=mid$(loc$,c,1)
  72. 800 if i$<="9" then i$=str$(val(i$))
  73. 810 if i$=>"a" then i$=str$(asc(i$)-55)
  74. 820 loc=loc+val(i$)*16^s
  75. 830 s=s-1
  76. 840 next c
  77. 850 return
  78. 860 for c=1 to 14
  79. 870 read code
  80. 880 print#8,chr$(code);
  81. 890 next c
  82. 900 data 169,000     :rem lda #$00
  83. 910 data 133,122     :rem sta $7a
  84. 920 data 169,008     :rem lda #$08
  85. 930 data 133,123     :rem sta $78
  86. 940 data 032,096,166 :rem jsr $a660
  87. 950 data 076,174,167 :rem jmp $a7ae
  88. 960 return
  89.